home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Belgian Amiga Club - ADF Collection
/
BS1 part 47.7z
/
BS1 part 47
/
ImageMaster RT v1.50b (1994)(Black Belt Systems)(Disk 6 of 7)[HD].7z
/
ImageMaster RT v1.50b (1994)(Black Belt Systems)(Disk 6 of 7)[HD].adf
/
piarc.lzh.parta
/
FlickWR1.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1994-03-17
|
5KB
|
162 lines
/*
This is the opening phase of the ARexx scripts for making Flicks's
This script gets three things from the user and sticks them into a
file in ram: so the other three phases of the process will know what
to do.
1 - The name of the Flick to create or extend is obtained
2 - The name template to be used for the individual frames is obtained.
3 - The number of jiffies between frames.
*/
/*
* open rexxsupport.library -- needed for some functions
*/
if ~show('L',"rexxsupport.library") then do
if addlib('rexxsupport.library',0,-30,0) then do
/* everything's ok */
end;
else do
say 'We Have A Library Problem, Unable To Load "rexxsupport.library"';
say 'Cannot operate FlickWR.rexx without this library - sorry!';
exit 10;
end;
end;
/*
* This will automatically direct the script to the proper
* software, if it is running.
*/
prtnme = 'IP_Port'; /* assume Image Professional */
if show('P','IP_Port') = 0 then do
if show('P','IM_Port') = 0 then do
say "Can't find image processor's ARexx port!!!"; /* not running? */
say "This script requires IP, IM or IM F/c to run!";
exit(20);
end;
else do
prtnme = 'IM_Port'; /* That's the thing about assumptions... */
end; /* We make em, user's break em. */
end;
options;
address;
prevpath = 'ram:'; /* put user in ram to start with... */
if show('C',flickpath) = 1 then do
prevpath = getclip(flickpath);
end;
address(prtnme);
options results;
'filerequest "'||prevpath||'","'||bufname||'",".flc","Make Flick"';
flickfile = result;
options;
if flickfile = 'FR_CANCELLED' then do
address(prtnme);
'imtofront';
exit 0;
end;
else do
flickfile = expandfilename(flickfile);
thispath = gimmepath(flickfile);
call setclip(flickpath,thispath);
end;
options results;
'askprop '||'"# of jiffies (60th / sec) between frames?" 2 1 180'
jiffies = result;
options;
res = open(fhandle,flickfile,'read');
if res ~= 0 then do
call close(fhandle);
address(prtnme);
options results;
'askyn '||'"Create New Flick" "Append to Existing Flick"'
prefs = result;
if prefs = 0 then do
address command 'c:delete >nil: '||flickfile;
end;
if prefs = 1 then do
options results;
'askyn '||'"Truncate before appending" "Append as is"'
prefs = result;
if prefs = 0 then do
address command 'cmpi:FlickWR -t '||jiffies||' '||flickfile;
end;
end;
end;
address(prtnme);
options results;
'askyn '||'"Create loop frame" "No loop frame"'
prefs = result;
call open(fhandle,'ram:IP_FLICKWR.CFG','write'); /* open the file */
junk = writeln(fhandle, jiffies);
junk = writeln(fhandle, flickfile);
junk = writeln(fhandle, prefs);
call close(fhandle); /* close the file */
address(prtnme);
'finish';
exit 0;
/*
* gimmepath
*
* This takes the provided argument and sucks the path out of it, then
* returns that path to the caller, sans file name.
*/
gimmepath:
arg fullnamegx;
tempgx = reverse(fullnamegx);
lengx = length(fullnamegx); /* get length of string */
slashdex = index(tempgx,'/'); /* first occurance of '/' from right */
colondex = index(tempgx,':'); /* first occurance of ':' from right */
seploc = 0; /* assumes current dir, no path supplied */
if slashdex ~= 0 then do /* we assume we are in a DIR */
seploc = (lengx - slashdex)+1;
end;
else do
if colondex ~= 0 then do /* we assume we are on a device */
seploc = (lengx - colondex)+1;
end;
end;
gxname = substr(fullnamegx,seploc+1); /* if you ever need it */
gxpath = left(fullnamegx,seploc);
return(gxpath);
/*
* Since this script can't be expected to know where the CD of the user
* is when this cmd is invoked, we have to check the path the user
* provides - if it's not specified right from a root, then we have
* to make it a complete specification from the root.
*/
expandfilename:
parse arg jfile;
if index(jfile,':') = 0 then do
curdir = pragma(D);
if right(curdir,1) ~= ':' then do
if right(curdir,1) ~= '/' then do
if curdir ~= '' then do
curdir = curdir || '/';
end;
end;
end;
jfile = curdir||jfile;
end;
return(jfile);
rvalue:
wordnum = c2d(readch(fhandle,1)) * 256;
wordnum = wordnum + c2d(readch(fhandle,1));
return wordnum;